public class HF_ClientWSContactPhone{
     
  @future (callout=true)
  public static void AddContactPhone(set<Id> phset) {
      string outputresult;
      List<Contact_Phone__c> phList = new List<Contact_Phone__c>([select Id,Partner_Contact_ID__c,Phone__c,Extension__c,Phone_Type_Code__c,Preferred__c,Country_Name__c,StatusCode__c,Description__c,Name_Id__c,Preferred_Flag__c from Contact_Phone__c where ID In: phset]); 
      WebServiceFinal4.BasicEndpoint s = new WebServiceFinal4.BasicEndpoint();
            for(Contact_Phone__c ph: phList){
                
                //Stores Phone details in PhonesWrapper
                WebServiceFinal2.PhoneWrapper p=new WebServiceFinal2.PhoneWrapper();
                    p.SfdcPhoneID = ph.Id;
                    p.PartnerContactID=ph.Partner_Contact_ID__c;
                    if(ph.Name_Id__c!=null){
                    p.NameID = Integer.Valueof(ph.Name_Id__c);  }
                    p.Phone=ph.Phone__c;
                    p.Extn=string.Valueof(ph.Extension__c);
                    p.PhoneType=ph.Phone_Type_Code__c;
                    p.PreferredPhone=ph.Preferred_Flag__c;
                    p.Comments=ph.Description__c;
                    p.Country=ph.Country_Name__c;
                    p.Status=ph.StatusCode__c;
                    p.DataOn=system.DateTime.Now();
            try{
                    outputresult=s.AddContactPhone(p);
                    system.debug('****'+outputresult);
               }    
            catch(Exception ex)
               {
                    system.debug('output from webservice: '+ex);       
               }
            }       
   } 
 
    @future (callout=true)
    public static void UpdateContactPhone(set<Id> phset) {
          string outputresult;
          List<Contact_Phone__c> phList = new List<Contact_Phone__c>([select Id,Name_Id__c,Country_Name__c,Partner_Contact_ID__c,Phone__c,Extension__c,Phone_Type_Code__c,Preferred_Flag__c,StatusCode__c,Description__c from Contact_Phone__c where ID In: phset]); 
          WebServiceFinal4.BasicEndpoint s = new WebServiceFinal4.BasicEndpoint();
          for(Contact_Phone__c ph: phList){
            system.debug('******'+ph);
            //Stores Phone details in PhonesWrapper
            WebServiceFinal2.PhoneWrapper p=new WebServiceFinal2.PhoneWrapper();
                    p.SfdcPhoneID = ph.Id;
                    p.PartnerContactID=ph.Partner_Contact_ID__c;
                    if(ph.Name_Id__c!=null){
                    p.NameID = Integer.Valueof(ph.Name_Id__c);}  
                    p.Phone=ph.Phone__c;
                    p.Extn=String.Valueof(ph.Extension__c);
                    p.PhoneType=ph.Phone_Type_Code__c;
                    p.PreferredPhone=ph.Preferred_Flag__c;
                    p.Comments=ph.Description__c;
                    p.Country=ph.Country_Name__c;
                    p.Status=ph.StatusCode__c;
                    p.DataOn=system.DateTime.Now();
            try
            {
                outputresult=s.UpdateContactPhone(p);
                system.debug('****'+outputresult);
            }
            catch(Exception ex)
            {
                system.debug('output from webservice: '+ex);       
            }
            }       
    } 
 }